<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%><%@ include file="/WEB-INF/jsp/include/jstl.jsp" %>
<div id="tech">
    <form name="settings.tech.form" id="settings.tech.form" method="post" action="/settings/tech">
	<ul>
    	<li>
        <div>
        <header><h1>IT经验</h1></header>
        <section>
        <input type="number" name="tech.experience" id="tech.experience" value="${tech.experience}" size="3"/> 年
        </section>
        </div>
        </li>
        <li>
        <div id="positions">
        	<header><h1>当前职位</h1></header>
            <section>
            <ul>
            <li>
            <c:forEach var="position" items="${tech.allPositions}" varStatus="status">
            <div style="width:250px;text-align:left;display:inline-block;">
            <input type="radio" name="tech.position" id="tech.position.${status.index}" value="${position.value}" <c:if test="${position.value==tech.position}">checked="true"</c:if>/>
            <label for="tech.position.${status.index}">${position.code}</label>
            </div>
            <c:if test="${(status.index+1)%4==0}"></li><li></c:if>
            </c:forEach>
            </li>
            </ul>
            </section>
        </div>
        <li>
            <div id="domains" class="m_content">
                <header><h1>请选择你关注的技术领域</h1></header>
                <section>
                    <ul>
                        <li>
                            <c:forEach var="domain" items="${tech.allDomains}" varStatus="status">
                            <div>
                            <input type="checkbox" name="tech.domains" id="tech.${domain.value}" value="${domain.value}"/>
                            <label for="tech.${domain.value}">${domain.code}</label>
                            </div>
                            <c:if test="${(status.index+1)%5==0}"></li><li></c:if>
                            </c:forEach>
                        </li>
                    </ul>
                    <input type="submit" name="submit" value="确定"/>
                </section>
            </div>
        </li>
    </ul>
    </form>
</div>
<script>
<c:if test="${not empty tech.domains}">
dojo.addOnLoad(function(){
	var selectedDomains = ",<c:forEach var='domain' items='${tech.domains}'>${domain},</c:forEach>";
	dojo.query('[name="tech.domains"]').forEach(function(item){
		if(selectedDomains.indexOf(","+item.value+",") >-1){
			item.checked="true";
		}
	});
});
</c:if>
</script>